/**
 * \file Plugin.h
 * \brief Plugin declaration class
 * \author Edouard ROGE
 * \date 16 Mars 2013
 */
#ifndef _PLUGIN_
#define _PLUGIN_

#include "Core/Memory/HeapObject.h"
#include "IPlugin.h"

namespace Core
{
	namespace Plugin
	{
		/**
		* \enum Type
		* \brief List all different kinds of plug-ins
		*/
		enum Type
		{
			Network = 0,
			GUI,
			//Render,
			//Sound,
			Count
		};
		class Plugin : public Memory::HeapObject
		{
		public:
			/**
			 * \fn Plugin()
			 * \brief Default constructor
			 */
			Plugin();

			/**
			 * \fn virtual ~Plugin()
			 * \brief Destructor
			 */
			virtual ~Plugin();

			/**
			 * \fn IPlugin * GetInterface() const
			 * \return Plug-in interface to get an access to the plug-in functions
			 * \brief Get the plug-in interface to get an access to the plug-in functions
			 */
			IPlugin * GetInterface() const;

			/**
			 * \fn error Load(const String & _strPluginName) = 0;
			 * \param _strPluginName name of the plug-in to load
			 * \return an error if occurs
			 * \brief Load a Plugin
			 */
			virtual error Load(const std::string & _strPluginName) = 0;

			/**
			 * \fn error Unload() = 0;
			 * \return an error if occurs
			 * \brief Unload a Plugin
			 */
			virtual error Unload() = 0;

		protected:

			/** Interface of the plug-in loaded */
			IPlugin * m_pInterface;

		};
	}
}

#endif // _PLUGIN_
